<template>
	<view class="flex_ZC">
		<view class="back flex_c">
			<image :src="baseUrl + '/static/icon/left_jt.png'" mode="aspectFill" @click="goBack"></image>
			<text>核销码</text>
		</view>
		<image class="hx_bgimg" :src="baseUrl +'/static/commonimg/bgImg2.jpg'" mode="aspectFill"></image>
		<view class="mask">
			
		</view>
		<view class="hxm flex_ZC">
			<text class="f30 c3 fw5">商家扫码劵码即可消费</text>
			<image class="ewm" src="https://pic1.imgdb.cn/item/67736de0d0e0a243d4ecfa06.png" mode="aspectFill"></image>
			<view class="tg_code flex_ZC">
				<text class="f30 c3 marin">核销码</text>
				<text class="f30 c3">232123CeE21df21</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				baseUrl: this.$imageBaseUrl,
			}
		},
		onLoad() {
			
		},

		methods: {
//获取页面栈的长度
			goBack() {
				const canNavBack = getCurrentPages()
				console.log(canNavBack.length);
				// 判断是否刷新了浏览器，刷新了浏览器，页面栈只有当前一个
				if (canNavBack.length > 1) {
					uni.navigateBack({
						delta: 1
					})
				} else {
					uni.switchTab({
						url: '/pages/index/cloudCatIndex'
					})
				}
			},
		},
	}
</script>

<style scoped>

	.back {
		position: fixed;
		/* #ifdef MP-WEIXIN */
		top: 88rpx;
		/* #endif */
		/* #ifdef H5 */
		top: 40rpx;
		/* #endif */
		left: 20rpx;
		width: 100%;
		height: 88rpx;
		z-index: 999;
	}
	
	.back>image {
		position: absolute;
		top: 50%;
		left: 0;
		transform: translateY(-50%);
		width: 60rpx;
		height: 60rpx;
	}
	.mask{
		width: 100%;
		height: 150rpx;
	}
	.hx_bgimg{
		position: absolute;
		top: 0;
		left: 0;
		width: 750rpx;
		height: 386rpx;
		z-index: 1;
	}
	.hxm{
		position: relative;
		width: 690rpx;
		height: 740rpx;
		background: #FFFFFF;
		border-radius:  24rpx;
		z-index: 2;
	}
	.hxm>text{
		margin-top: 58rpx;
	}
	.ewm{
		width: 426rpx;
		height: 426rpx;
		margin-top: 34rpx;
	}
	.tg_code{
		position: absolute;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 134rpx;
		border-top: 1rpx dashed #e6e6e6;
	}
	.marin{
		margin: 28rpx 0 4rpx;
	}
	
</style>